package com.supermap.business.station;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dubbo.api.AgriStation.ArgiStationService;
import com.supermap.dubbo.api.AgriStation.entity.AgriStationLiveData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author:zhoujian
 * @Desciption:
 * @date:2019-04-02 22:02
 * @version:v1.0.0
 */
@RestController
@RequestMapping("agriStation")
public class ArgiStationController {

    protected final Logger logger = LoggerFactory.getLogger(this.getClass());
    @Value("${agri.station.live.element}")
    private String elements;
    @Value("${agri.station.live.url}")
    private String Url ;

//    @Reference(timeout = 200000)
//    private ArgiStationService argiStationService;

    @RequestMapping("getArgiStationLiveDataByDateRange")
    public Object getArgiStationLiveData(@RequestParam(value="station") String station , @RequestParam(value="nowDateTime") String nowDateTime , @RequestParam(value="length") int length)
    {
        logger.info("开始调用农业气象观测站数据");
        String[] elementArray = elements.split(",");

        return null;//argiStationService.getAgriStationLiveDataByDateRange(Url ,elementArray, station,nowDateTime,length );
    }
}